package core

import (
	"xinduobang/stock/common"
)

// 初始化组件
func RegisterPlugs(cfg *common.Config) {
	// 初始化log logrus
	//initLogger(cfg.Log)

	initMysql(cfg.Mysql)

	//initJson()

	//initRedis(cfg.Redis)

	//
	//// mysql初始化
	//client.InitMysql(&config.MysqlXms, client.DB_XMS)
	//fmt.Printf("mysql初始化完成:%v\n", time.Now().Format("2006-01-02 15:04:05"))
	//
	//// redis初始化
	//client.InitRedis(&config.RedisDefault, client.REDIS_DEFAULT)
	//fmt.Printf("redis初始化完成:%v\n", time.Now().Format("2006-01-02 15:04:05"))
	//
	//// item初始化
	//client.InitItemClientFactory(&config.ItemClient)
	//fmt.Printf("itemClient初始化完成:%v\n", time.Now().Format("2006-01-02 15:04:05"))

}

// 注销组件
func UnRegisterPlugs(uuidStr string) {
	CloseMysql(uuidStr)

	//CloseRedis()

	//log.Close()
}
